The present application relates to mapping values from a source file into a result file.
Documents, referred to as result documents, may use values from other documents that may be referred to as source documents. For example, a result document may be a listing of customer names: first name then last name. The values for the first and last names may be located in a source document of customer information that includes the first and last names of customers and may also include other information such as a customer address and number, for example.
The values in the source document may not be in the same order that the values are used, or called-for, in the result document. Continuing with the example, the customer's name in the source document may be first name then last name. The first and last name values in the source document also may be separated by other values. The result document may call for the value for last name followed by the first name.
Some document types only may be accessed, also referred to as parsed, sequentially. An extensible mark-up language (XML) document is an example of a document that may only be parsed sequentially. Sequentially accessible files may only be parsed in one direction, from beginning to end, for example. The value for first name in the source document is sequentially before the value for last name in the example above. The result file first calls for the value of customer last name. The source document may be parsed sequentially until the value for customer last name is located. The value for last name then may be provided for use in the result document. The result document next calls for the value of first name from the source document. Because the source document may only be parsed sequentially and the value for the customer first name has been passed, the parser, in this example, must restart parsing from the beginning of the document to locate the customer first name. In order to reduce the re-parsing of the source document, the values called for by the result document may be stored in a values storage cache until they are needed. In the example, the value for the customer first name may be stored in the value storage cache until the value for the customer last name is located. The values for last name and first name may both be stored in the values storage cache and provided to the result document when called for.